]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-util: Fix warning in shell_util_cursor_tracker_to_clutter
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 23 Feb 2014 15:52:59 +0000 (10:52 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 23 Feb 2014 15:54:32 +0000 (10:54 -0500)
If the sprite is NULL, like if a Wayland app wanted to hide the cursor,
then we need to hide the ClutterTexture on our side, as ClutterTexture
has no easy way to tell it to paint nothing.

src/shell-util.c

index bbbb86fcbba38b0cd4b4a0c002d2c11a9317a758..61676ecd90f6b8885351a4ef9f64845ce54d2524 100644 (file)
@@ -347,5 +347,13 @@ shell_util_cursor_tracker_to_clutter (MetaCursorTracker *tracker,
   CoglTexture *sprite;
 
   sprite = meta_cursor_tracker_get_sprite (tracker);
-  clutter_texture_set_cogl_texture (texture, sprite);
+  if (sprite)
+    {
+      clutter_actor_show (CLUTTER_ACTOR (texture));
+      clutter_texture_set_cogl_texture (texture, sprite);
+    }
+  else
+    {
+      clutter_actor_hide (CLUTTER_ACTOR (texture));
+    }
 }